{{- if ($.Values.global.enabledModules | has "log-shipper") }}
{{- if .Values.flantIntegration.logs }}
---
apiVersion: deckhouse.io/v1alpha1
kind: ClusterLogDestination
metadata:
  name: flant-integration-loki-storage
  {{- include "helm_lib_module_labels" (list . (dict "app" "flant-integration")) | nindent 2 }}
spec:
  buffer:
    memory:
      maxEvents: 10240
    type: Memory
    whenFull: DropNewest
  loki:
    # We need / in the end of storage endpoint. Vector concat URI without /
    endpoint: {{ trimSuffix "/" .Values.flantIntegration.logs.url }}/
    auth:
      strategy: Bearer
      token: {{ .Values.flantIntegration.internal.licenseKey }}
  type: Loki
  extraLabels:
    cluster_uuid: {{ .Values.global.discovery.clusterUUID | quote}}
{{- end }}
{{- end }}
